package com.andy.eqm.server.game;

import com.andy.eqm.server.entity.ConfItem;
import com.andy.eqm.server.entity.ConfProbability;
import com.andy.eqm.server.entity.UsrGameInfo;
import com.andy.eqm.server.socket.MySocketSession;
import com.andy.eqm.server.socket.SendUtil;

public class GiftUtil {

	static ConfItem confItem = GameConf.getConfItem(1000001);
	
	public static void createGift() {
		ConfProbability item = confItem.tryRateItem();
		
		for(MySocketSession ses:Global.getUserSessions()){
			GameUser user = ses.getUser();
			if(user != null){
				user.addItem(item.getItemId(),item.getItemSize());
				SendUtil.send110(ses,item.getItemId());
			}
		}
		
	}

	public static void genGift(UsrGameInfo gameInfo) {
		ConfProbability item = confItem.tryRateItem();
		gameInfo.addItem(item.getItemId(),item.getItemSize());
	}
	
	

	
}
